<template>
  <div class="app">
    <el-container>
      <el-header>
        <el-menu
          mode="horizontal"
          router
          :ellipsis="false"
          class="nav-menu"
        >
          <el-menu-item index="/">
            <h1 class="logo">电影推荐系统</h1>
          </el-menu-item>
          <div class="flex-grow" />
          <el-menu-item index="/">首页</el-menu-item>
          <el-menu-item index="/analytics">数据分析</el-menu-item>
        </el-menu>
      </el-header>

      <el-main>
        <router-view v-slot="{ Component }">
          <transition name="fade" mode="out-in">
            <component :is="Component" />
          </transition>
        </router-view>
      </el-main>

      <el-footer>
        <p>&copy; 2023 电影推荐系统. All rights reserved.</p>
      </el-footer>
    </el-container>
  </div>
</template>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

.app {
  min-height: 100vh;
}

.el-container {
  min-height: 100vh;
}

.el-header {
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-menu {
  height: 60px;
  border-bottom: none;
}

.logo {
  font-size: 1.5rem;
  margin: 0;
  color: #409EFF;
}

.flex-grow {
  flex-grow: 1;
}

.el-main {
  padding: 20px;
  background-color: #f5f7fa;
}

.el-footer {
  text-align: center;
  padding: 20px;
  color: #666;
  background-color: #fff;
  border-top: 1px solid #eee;
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}
</style> 